//
//  SendIFMacros.h
//  TravelHeNan
//
//  Created by Apple on 13-12-11.
//  Copyright (c) 2013年 __MyCompanyName__. All rights reserved.
//

#import <Foundation/Foundation.h>

#ifndef SendIFMacros_h
#define SendIFMacros_h

//输出详细log,显示方法及所在的行数
// 2.日志输出宏定义
#ifdef DEBUG
// 调试状态
#define DLog(format, ...) do {                                              \
fprintf(stderr, ">------------------------------\n<%s : %d> %s\n",                                           \
[[[NSString stringWithUTF8String:__FILE__] lastPathComponent] UTF8String],  \
__LINE__, __func__);                                                        \
(NSLog)((format), ##__VA_ARGS__);                                           \
fprintf(stderr, "-----------------------------------\n");                                               \
} while (0)
#else
// 发布状态
#define DLog(...)
#endif

//#define DLog(fmt, ...) NSLog((@"%s [Line %d] " fmt), __PRETTY_FUNCTION__, __LINE__, ##__VA_ARGS__);

#define VIEW_BACKGROUND [UIColor colorWithRed:226.f/255 green:226.f/255 blue:226.f/255 alpha:1.0]

#define SET_COLORS(A,B,C) ([UIColor colorWithRed:A/255 green:B/255 blue:C/255 alpha:1.0])




#define SCREEN_HEIGHT ([UIScreen mainScreen].bounds.size.height)

//A better version of NSLog
#define BACK_POP UIBarButtonItem *left = [[UIBarButtonItem alloc] initWithTitle:@"< 返回" style:UIBarButtonItemStyleDone target:self action:@selector(back)];\
self.navigationItem.leftBarButtonItem = left;

#define ALERT_WARN(MSG) ([[[UIAlertView alloc] initWithTitle:@"提示" message:MSG delegate:nil cancelButtonTitle:@"确定" otherButtonTitles:nil,nil] show])

#define isIOS6 [[UIDevice currentDevice].systemVersion intValue]==6?1:0
//切换内外网，0表示内网，1表示外网
#ifndef SERVER_TYPE
#define SERVER_TYPE 0
#endif



#define SERVER_PATH @"boss/service/mobile/code.htm"

//测试服务器
#if SERVER_TYPE == 0
static NSString *const SendIFServer = @"http://192.168.0.206:9300";

//正式服务器
#elif SERVER_TYPE == 1
static NSString *const SendIFServer = @"";

#endif

// 支付宝公钥
#define AlipayPubKey @"MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQCAAeeQyaIs+DvTe48pH56/cPZ/0gHlO0kHfrcQFRvpPOlerpWh1+QGVR1KhgeOOoSkQuguPKcpULIk8X+wUBVuswx9ZwO5f5cIjcDIc3ird7soBBSzS5paewpF1zJPT+51B71VqoOljlgSY5R9akeo35ziJXDCCGlPm6zm23FRwwIDAQAB"

// 通知
#define KNotification @"BuyNotification"
#define KNotificationNeedShadow @"NEEDSHADOW"
#define KNotificationNOTNeedShadow @"NOTNEEDSHADOW"
#define KNotificationRevealRevealController @"RevealRevealController"
#define KNOTIFYNameHeadViewClick @"NameHeadViewClick"
#define KNotificationNewWorkFAIL @"NETWORKFAIL"

//移除侧滑手势
#define REMOVE_SLIDERGESTURE [self.navigationController.navigationBar removeGestureRecognizer:self.navigationBarPanGestureRecognizer]

#define ADDSTRING(A,B)  [NSString stringWithFormat:@"%@:%@",A,B]

#define kNote             @"提示"
#define kConfirm          @"确定"
#define kErrorNet         @"网络错误"
#define kResult           @"支付：%@"

#endif
